﻿using System;
using EasyNetQ;

namespace Nl.RabbitMq.Demo.EasyNetQWrapper
{
    [Queue("MQErrorQueue", ExchangeName = "MQErrorExchange")]
    public class MqExcepotionMessage  
    {
        public MqExcepotionMessage(string message, Exception ex)
        {
            ErrorTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
            if (ex != null)
            {
                //ErrorInfo = ex.Message;
                //ErrorSource = ex.Source;
                //ErrorType = ex.GetType().ToString();
                //ErrorFunction = ex.TargetSite.ToString();
                //ErrorTrace = ex.StackTrace;
            }

      
            Message = message;
        }
        public string Message { get; set; }
        public string ErrorTime { get; set; }
        public string ErrorInfo { get; set; }
        public string ErrorSource { get; set; }
        public string ErrorType { get; set; }
        public string ErrorFunction { get; set; }
        public string ErrorTrace { get; set; }
    }
}